<?php
class User extends CI_Model
{
    function login($username, $password)
    {
        $this->db->select('userId, username, password, userRoleId');
        $this->db->from('user');
        $this->db->where('username', $username);
        $this->db->where('password', $password);
        $this->db->limit(1);

        $query = $this->db->get();

        if ($query->num_rows() == 1) {
            return true;
        } else {
            return false;
        }
    }
}
?>

